/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package th.manager;

import com.google.inject.Inject;
import java.util.List;
import net.sourceforge.stripes.action.UrlBinding;
import org.hibernate.Query;
import org.hibernate.Session;
import th.dao.KodAlasanDAO;

/**
 *
 * @author HARISH
 */

public class YearManager {
    
    @Inject
    protected com.google.inject.Provider<Session> sessionProvider;
    @Inject
    private KodAlasanDAO kodAlasanDAO;
    
    public String getNormalYear(String islamicYear) {
        int i=0;
        Session session = sessionProvider.get();
        Query query = session.createQuery("select a.year from TahunPilihan a "+ "where a.islamicYear = :islamicYear");
        query.setString("islamicYear", islamicYear);
        List l1=query.list();
        return String.valueOf(l1.get(i));
    }
    
}
